/*
 * @Author: your name
 * @Date: 2020-07-07 19:01:57
 * @LastEditTime: 2020-08-07 16:35:24
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ryfront\src\router\index.js
 */ 
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//路由懒加载模式
const Resources = () => import('@/modules/resources/Index');
const Dic = () => import('@/modules/dic/Index');
const Roles = () => import('@/modules/roles/Index');
const Users = () => import('@/modules/users/Index');

const Login = () => import('@/components/Login');
const Index = () => import('@/modules/Index');

export default new Router({
  routes: [
    {
      path: '/login',
      name:'login',
      component: Login
    },
    {
      path: '/index',
      name:'Index',
      component: Index,
      children:[
        {
          path:'/resources',
          name:'resources',
          component: Resources,
        },
        {
          path:'/dic',
          name:'dic',
          component: Dic,
        },
        {
          path:'/roles',
          name:'roles',
          component: Roles,
        },
        {
          path:'/users',
          name:'users',
          component: Users,
        }
      ]
    }
  ]
})
